package com.lanou.myapp.news.recommendednews.contentrecommendednews;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lanou.myapp.R;

/**
 * Created by dllo on 16/1/20.
 */
public class ContentRecommendedNewsActivity extends AppCompatActivity{
    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.content_recommended_news_activity);
        webView = (WebView) findViewById(R.id.wv_recommended_news);
        Intent intent = getIntent();
        String url = intent.getStringExtra("key");

        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
        webView.loadUrl(url);
    }
}
